On the Termination of Higher-Order Positive Supercompilation
نویسنده
چکیده
The verification of program transformation systems requires that we prove their termination. For positive supercompilation, ensuring termination requires the memoisation of expressions which are subsequently used to determine when to perform generalization and folding. For a first-order language, it is sufficient to memoise only those expressions immediately prior to a function unfolding step. However, for a higher-order language, this is not sufficient to ensure termination, so more expressions need to be memoised. Determining which additional expressions to memoise can greatly affect the results obtained. Memoising too many expressions requires a lot more expensive checking for the possibility of generalization or folding; more new functions will also be created and generalization will be performed more often, resulting in less improved residual programs. We would therefore like to memoise as few expressions as possible while still ensuring termination. In this paper, we describe a simple pre-processing step which can be applied to higher-order programs prior to transformation by positive supercompilation to ensure that in any potentially infinite sequence of transformation steps there must be function unfolding. We prove, for programs that have been pre-processed in this way, that it is only necessary to memoise expressions immediately before function unfolding to ensure termination, and we demonstrate this on a number of tricky examples.
منابع مشابه
Positive Supercompilation for a Higher Order Call-By-Value Language Extended Proofs
Previous deforestation and supercompilation algorithms may introduce accidental termination when applied to call-by-value programs. This hides looping bugs from the programmer, and changes the behavior of a program depending on whether it is optimized or not. We present a supercompilation algorithm for a higher-order call-by-value language and we prove that the algorithm both terminates and pre...
متن کاملLocal Driving in Higher-Order Positive Supercompilation via the Ω-theorem
A program transformation technique should terminate, return efficient output programs and be efficient itself. These requirements are mutually conflicting, so a balance must be sought between definite termination and possible efficiency. For positive supercompilation [17], ensuring termination requires memoisation of expressions, and these are subsequently used to determine when to perform gene...
متن کاملAn Algorithm of Generalization in Positive Supercompilation
This paper presents a termination technique for positive supercompilation, based on notions from term algebra. The technique is not particularily biased towards positive supercompilation, but also works for deforestation and partial evaluation. It appears to be well suited for partial deduction too. The technique guarantees termination, yet it is not overly conservative. Our technique can be vi...
متن کاملOn Perfect Supercompilation
We extend positive supercompilation to handle negative as well as positive information. This is done by instrumenting the underlying unfold rules with a small rewrite system that handles constraints on terms, thereby ensuring perfect information propagation. We illustrate this by transforming a näıvely specialised string matcher into an optimal one. The presented algorithm is guaranteed to term...
متن کاملTowards Higher-Level Supercompilation
We show that the power of supercompilation can be increased by constructing a hierarchy of supercompilers, in which a lowerlevel supercompiler is used by a higher-level one for proving improvement lemmas. The lemmas thus obtained are used to transform expressions labeling nodes in process trees, in order to avoid premature generalizations. Such kind of supercompilation, based on a combination o...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013